package com.nian.service.impl;

import com.nian.dao.UserDao;
import com.nian.dao.impl.UserDaoImpl;
import com.nian.pojo.Product;
import com.nian.pojo.User;
import com.nian.service.UserService;

import java.util.List;

public class UserServiceImpl implements UserService {
    UserDao userDao = new UserDaoImpl();

    @Override
    public boolean isRegister(User user) {
        return userDao.addUser(user);
    }

    @Override
    public User login(User user) {
        return userDao.selectUserByUsernameAndPassword(user);
    }

    @Override
    public boolean isExistsUsername(User user) {
        return (userDao.selectUserByUsername(user))!=null;
    }

}
